/*
 * @Description: 
 * @Author: zyj
 * @Date: 2022-05-27 17:07:02
 * @LastEditors: zyj
 * @LastEditTime: 2022-05-27 17:07:32
 */
/* 手机号正则、时间格式正则 */
let reg1 = /^1[35789]\d{9}$/;
let reg2 = /^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/;



/* 实现千分符 */
function format(num) {
  return num.replace(/(\d{1,3})(?=(\d{3})+(\.\d+)?$)/g, '$1,');
}


console.log(format("1159265654.25"));
console.log(format("15926565"));